﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/ContentManageMaster.Master"
    AutoEventWireup="true" CodeBehind="NaviPageUpdate.aspx.cs" Inherits="Omes.Admin.ContentManage.NaviPageUpdate" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript" src="/Xheditor/xheditor-1.1.13-zh-cn.min.js"></script>
    <ul id="contentul">
        <li><a id="editselfcontent">编辑栏目内容</a></li><li><a id="addchildrencontent">添加子栏目</a></li><li>
            <a id="childrenlistedit">子栏目列表</a></li></ul>
    <table id="editselfcontenttable">
        <tr>
            <td style="width: 20%; background-color: Yellow;">
                栏目名称:
            </td>
            <td>
                <label id="menuName"><%=BarInfo.PageName %>
                </label>
            </td>
        </tr>
        <tr>
            <td style="width: 20%; background-color: Yellow;">
                页面类型:
            </td>
            <td>
                <select id="menutype">
                </select>
            </td>
        </tr>
        <tr>
            <td style="width: 20%; background-color: Yellow;">
                父页面:
            </td>
            <td>
                <select id="parentpage">
                </select>
            </td>
        </tr>
        <tr>
            <td style="width: 20%; background-color: Yellow;">
                是否显示在导航:
            </td>
            <td>
                <select id="showflag">
                    <option value="true">是</option>
                    <option value="false" selected="selected">否</option>
                </select>
            </td>
        </tr>
        <tr>
            <td style="width: 20%; background-color: Yellow;">
                打开方式:
            </td>
            <td>
                <select id="openway">
                    <option value="true">新窗口</option>
                    <option value="false" selected="selected">原窗口</option>
                </select>
            </td>
        </tr>
        <tr>
            <td style="width: 20%; background-color: Yellow;">
                &nbsp;
            </td>
            <td>
                <input type="button" style="width: 15%" id="updatemenubtn" value="更新" />
            </td>
        </tr>
    </table>
    <table id="addchildrencontenttable">
        <tr>
            <td style="height: 80%; width: 100%;">
                <textarea id="textareacontent" name="navicontent"></textarea>
            </td>
        </tr>
        <tr>
            <td style="height: 10px; width: 100%;">
                <asp:Button ID="savechild" runat="server" Text="提交信息" />
            </td>
        </tr>
    </table>
    <table id="childrenlistedittable">
        <tr>
            <td>
                two
            </td>
        </tr>
    </table>
    <script src="../Scripts/myjs.js" type="text/javascript"></script>
    <script type="text/javascript">
        $().ready(function () {
            tableshowhide("addchildrencontenttable");

            $("#contentul a").click(function () {
                $("#contentul a").removeClass("mousein")
                $("#contentul a").removeClass("mouseinb");
                $("#" + $(this).attr("id")).addClass("mouseinb");

                //让所有table隐藏，指定table显示
                tableshowhide($(this).attr("id") + "table");
                //让编辑的bar的内容显示
                showtablecontent('<%=BarInfo.Id %>','<%=BarInfo.PageTypeId %>',"<%=BarInfo.ShowOnNar %>","<%=BarInfo.NewWindow %>");
            });

            $("#textareacontent").xheditor({
                width: 770,
                height: 400,
                upImgUrl:"/upload.aspx",
                upImgExt:"jpg"
            });
        });

        function tableshowhide(id) {
            $("#editselfcontenttable").hide();
            $("#addchildrencontenttable").hide();
            $("#childrenlistedittable").hide();
            $("#" + id).show();
        }

        function showtablecontent(id, parentid, showflag, openway) {
            var types = GetMenuTypes();
            for (i = 0; i < types.length; i++) {
                $("#menutype").append("<option value=" + types[i].Id + ">" + types[i].PageTypeName + "</option>");
            }
            $("#menutype").val(id);
            var pages = GetMenuParentPages();
            for (i = 0; i < pages.length; i++) {
                $("#parentpage").append("<option value=" + pages[i].Id + ">" + pages[i].PageName + "</option>");
            }
            $("#parentpage").val(parentid);
            $("#showflag").val(showflag);
            $("#openway").val(openway);
        }
    </script>
</asp:Content>
